//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <elastos.h>
_ELASTOS_NAMESPACE_USING
#include "_CByteArrayInputStreamClassObject_.h"
#include "_CByteArrayOutputStreamClassObject_.h"
#include "_CFileInputStreamClassObject_.h"
#include "_CFileOutputStreamClassObject_.h"
#include "_CBufferedInputStreamClassObject_.h"
#include "_CBufferedOutputStreamClassObject_.h"
#include "_CAStringInputStreamClassObject_.h"
#include "_CWStringInputStreamClassObject_.h"
#include "_CDataInputStreamClassObject_.h"
#include "_CDataOutputStreamClassObject_.h"
#include "_CGZipInputStreamClassObject_.h"
#include "_CGZipOutputStreamClassObject_.h"

EXTERN_C const _ELASTOS ClassID ECLSID_TApplet;

extern "C" _CBaseClassObject _g_AObjectEx_ClsObj;
extern "C" _CBaseClassObject _g_AObjectContainer_ClsObj;
extern "C" _CBaseClassObject _g_CDeviceEventDispatcher_ClsObj;
extern "C" _CBaseClassObject _g_TApplet_ClsObj;

extern "C" _CByteArrayInputStreamClassObject_ _g__CByteArrayInputStreamClassObject__ClsObj;
extern "C" _CByteArrayOutputStreamClassObject_ _g__CByteArrayOutputStreamClassObject__ClsObj;
extern "C" _CAStringInputStreamClassObject_ _g__CAStringInputStreamClassObject__ClsObj;
extern "C" _CWStringInputStreamClassObject_ _g__CWStringInputStreamClassObject__ClsObj;
extern "C" _CFileInputStreamClassObject_ _g__CFileInputStreamClassObject__ClsObj;
extern "C" _CFileOutputStreamClassObject_ _g__CFileOutputStreamClassObject__ClsObj;
extern "C" _CBufferedInputStreamClassObject_ _g__CBufferedInputStreamClassObject__ClsObj;
extern "C" _CBufferedOutputStreamClassObject_ _g__CBufferedOutputStreamClassObject__ClsObj;
extern "C" _CDataInputStreamClassObject_ _g__CDataInputStreamClassObject__ClsObj;
extern "C" _CDataOutputStreamClassObject_ _g__CDataOutputStreamClassObject__ClsObj;
extern "C" _CGZipInputStreamClassObject_ _g__CGZipInputStreamClassObject__ClsObj;
extern "C" _CGZipOutputStreamClassObject_ _g__CGZipOutputStreamClassObject__ClsObj;

EXTERN_C CARAPI _CarDllGetClassObject(
    REMuid rclsid, REIID riid, IInterface **ppObj)
{
    if (ECLSID_AObjectEx == rclsid) {
        *ppObj = _g_AObjectEx_ClsObj.Probe(riid);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID_AObjectContainer == rclsid) {
        *ppObj = _g_AObjectContainer_ClsObj.Probe(riid);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID_CDeviceEventDispatcher == rclsid) {
        *ppObj = _g_CDeviceEventDispatcher_ClsObj.Probe(riid);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CAStringInputStreamClassObject_ == rclsid) {
        *ppObj = (PInterface)_g__CAStringInputStreamClassObject__ClsObj.Probe(EIID__CAStringInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CWStringInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CWStringInputStreamClassObject__ClsObj.Probe(EIID__CWStringInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CByteArrayInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CByteArrayInputStreamClassObject__ClsObj.Probe(EIID__CByteArrayInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CByteArrayOutputStreamClassObject_ == rclsid) {
        *ppObj = _g__CByteArrayOutputStreamClassObject__ClsObj.Probe(EIID__CByteArrayOutputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CFileInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CFileInputStreamClassObject__ClsObj.Probe(EIID__CFileInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CFileOutputStreamClassObject_ == rclsid) {
        *ppObj = _g__CFileOutputStreamClassObject__ClsObj.Probe(EIID__CFileOutputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CBufferedInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CBufferedInputStreamClassObject__ClsObj.Probe(EIID__CBufferedInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CBufferedOutputStreamClassObject_ == rclsid) {
        *ppObj = _g__CBufferedOutputStreamClassObject__ClsObj.Probe(EIID__CBufferedOutputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CDataInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CDataInputStreamClassObject__ClsObj.Probe(EIID__CDataInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if (ECLSID__CDataOutputStreamClassObject_ == rclsid) {
        *ppObj = _g__CDataOutputStreamClassObject__ClsObj.Probe(EIID__CDataOutputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if(ECLSID__CGZipInputStreamClassObject_ == rclsid) {
        *ppObj = _g__CGZipInputStreamClassObject__ClsObj.Probe(EIID__CGZipInputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    else if(ECLSID__CGZipOutputStreamClassObject_ == rclsid) {
        *ppObj = _g__CGZipOutputStreamClassObject__ClsObj.Probe(EIID__CGZipOutputStream_IClassObject_);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    if (ECLSID_TApplet == rclsid) {
        *ppObj = _g_TApplet_ClsObj.Probe(riid);
        if (*ppObj) (*ppObj)->AddRef();
        else return E_NO_INTERFACE;
        return NOERROR;
    }
    return E_CLASS_NOT_AVAILABLE;
}
